home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: Re: sizeof() question >>> :)
- Date: 14 Apr 1996 09:02:59 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4kr7jjINN1m7@keats.ugrad.cs.ubc.ca>
- References: <1996Apr12.061927@topaz> <4kp5dv$3vu@nadine.teleport.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4kp5dv$3vu@nadine.teleport.com>,
- Jeff Grossman <grossman@teleport.com> wrote:
- >naderr@topaz.cqu.edu.au wrote:
- >>Hi,
- >>
- >>How can I get, with a pointer, the sizeof of an array that is
- >>pointed by the pointer ? (No it's not a tounge twister :)
- >>
- >
- >[code snippet snipped]
- >
- >If I followed your question correctly, you're not looking for
- >an array size but a string length. Try looking at the strlen
- >function.
-
- No he isn't, and hence, no you didn't :)
-
- The string length of his arrays, before he reads input into them, is undefined
- or zero depending on whether their storage type is auto or static.
-
- A computation of string length is of absolutely no use here whatsoever, since
- he wants to know the destination buffer size that he is reading into, and
- therefore the array size is of utmost interest.
-